From: Andrew Cooper Date: Mon, 25 Nov 2013 11:06:38 +0000 (+0000) Subject: tools/xenconsole: Use xc_domain_getinfo() correctly X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5877 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=aa344500a3bfceb3ef01931609ac1cfaf6dcf52d;p=xen.git tools/xenconsole: Use xc_domain_getinfo() correctly Coverity ID: 1055018 Signed-off-by: Andrew Cooper CC: Ian Campbell Acked-by: Ian Jackson --- diff --git a/tools/console/client/main.c b/tools/console/client/main.c index 523fc23ed5..38c856a112 100644 --- a/tools/console/client/main.c +++ b/tools/console/client/main.c @@ -339,7 +339,11 @@ int main(int argc, char **argv) xc_interface *xc_handle = xc_interface_open(0,0,0); if (xc_handle == NULL) err(errno, "Could not open xc interface"); - xc_domain_getinfo(xc_handle, domid, 1, &xcinfo); + if ( (xc_domain_getinfo(xc_handle, domid, 1, &xcinfo) != 1) || + (xcinfo.domid != domid) ) { + xc_interface_close(xc_handle); + err(errno, "Failed to get domain information"); + } /* default to pv console for pv guests and serial for hvm guests */ if (xcinfo.hvm) type = CONSOLE_SERIAL;